3.350 \(\int \frac{\tan ^5(e+f x)}{(a+b \sec ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=77 \[ -\frac{\left (\frac{1}{a^2}-\frac{1}{b^2}\right ) \log \left (a \cos ^2(e+f x)+b\right )}{2 f}-\frac{(a+b)^2}{2 a^2 b f \left (a \cos ^2(e+f x)+b\right )}-\frac{\log (\cos (e+f x))}{b^2 f} \]

[Out]

-(a + b)^2/(2*a^2*b*f*(b + a*Cos[e + f*x]^2)) - Log[Cos[e + f*x]]/(b^2*f) - ((a^(-2) - b^(-2))*Log[b + a*Cos[e
 + f*x]^2])/(2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.105814, antiderivative size = 77, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4138, 446, 88} \[ -\frac{\left (\frac{1}{a^2}-\frac{1}{b^2}\right ) \log \left (a \cos ^2(e+f x)+b\right )}{2 f}-\frac{(a+b)^2}{2 a^2 b f \left (a \cos ^2(e+f x)+b\right )}-\frac{\log (\cos (e+f x))}{b^2 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^5/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-(a + b)^2/(2*a^2*b*f*(b + a*Cos[e + f*x]^2)) - Log[Cos[e + f*x]]/(b^2*f) - ((a^(-2) - b^(-2))*Log[b + a*Cos[e
 + f*x]^2])/(2*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rubi steps

\begin{align*} \int \frac{\tan ^5(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^2}{x \left (b+a x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(1-x)^2}{x (b+a x)^2} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{1}{b^2 x}-\frac{(a+b)^2}{a b (b+a x)^2}+\frac{-a^2+b^2}{a b^2 (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{(a+b)^2}{2 a^2 b f \left (b+a \cos ^2(e+f x)\right )}-\frac{\log (\cos (e+f x))}{b^2 f}-\frac{\left (\frac{1}{a^2}-\frac{1}{b^2}\right ) \log \left (b+a \cos ^2(e+f x)\right )}{2 f}\\ \end{align*}

Mathematica [A]  time = 0.45452, size = 109, normalized size = 1.42 \[ -\frac{\sec ^4(e+f x) (a \cos (2 e+2 f x)+a+2 b)^2 \left (\left (\frac{1}{a^2}-\frac{1}{b^2}\right ) \log \left (a \cos ^2(e+f x)+b\right )+\frac{(a+b)^2}{a^2 b \left (a \cos ^2(e+f x)+b\right )}+\frac{2 \log (\cos (e+f x))}{b^2}\right )}{8 f \left (a+b \sec ^2(e+f x)\right )^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^5/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-((a + 2*b + a*Cos[2*e + 2*f*x])^2*((a + b)^2/(a^2*b*(b + a*Cos[e + f*x]^2)) + (2*Log[Cos[e + f*x]])/b^2 + (a^
(-2) - b^(-2))*Log[b + a*Cos[e + f*x]^2])*Sec[e + f*x]^4)/(8*f*(a + b*Sec[e + f*x]^2)^2)

________________________________________________________________________________________

Maple [A]  time = 0.087, size = 126, normalized size = 1.6 \begin{align*}{\frac{\ln \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f{b}^{2}}}-{\frac{1}{2\,fb \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{1}{fa \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{\ln \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,{a}^{2}f}}-{\frac{b}{2\,{a}^{2}f \left ( b+a \left ( \cos \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{\ln \left ( \cos \left ( fx+e \right ) \right ) }{f{b}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^5/(a+b*sec(f*x+e)^2)^2,x)

[Out]

1/2/f/b^2*ln(b+a*cos(f*x+e)^2)-1/2/f/b/(b+a*cos(f*x+e)^2)-1/f/a/(b+a*cos(f*x+e)^2)-1/2*ln(b+a*cos(f*x+e)^2)/a^
2/f-1/2*b/a^2/f/(b+a*cos(f*x+e)^2)-ln(cos(f*x+e))/b^2/f

________________________________________________________________________________________

Maxima [A]  time = 1.01365, size = 132, normalized size = 1.71 \begin{align*} \frac{\frac{a^{2} + 2 \, a b + b^{2}}{a^{3} b \sin \left (f x + e\right )^{2} - a^{3} b - a^{2} b^{2}} - \frac{\log \left (\sin \left (f x + e\right )^{2} - 1\right )}{b^{2}} + \frac{{\left (a^{2} - b^{2}\right )} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{2} b^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/2*((a^2 + 2*a*b + b^2)/(a^3*b*sin(f*x + e)^2 - a^3*b - a^2*b^2) - log(sin(f*x + e)^2 - 1)/b^2 + (a^2 - b^2)*
log(a*sin(f*x + e)^2 - a - b)/(a^2*b^2))/f

________________________________________________________________________________________

Fricas [A]  time = 0.743636, size = 262, normalized size = 3.4 \begin{align*} -\frac{a^{2} b + 2 \, a b^{2} + b^{3} -{\left (a^{2} b - b^{3} +{\left (a^{3} - a b^{2}\right )} \cos \left (f x + e\right )^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) + 2 \,{\left (a^{3} \cos \left (f x + e\right )^{2} + a^{2} b\right )} \log \left (-\cos \left (f x + e\right )\right )}{2 \,{\left (a^{3} b^{2} f \cos \left (f x + e\right )^{2} + a^{2} b^{3} f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/2*(a^2*b + 2*a*b^2 + b^3 - (a^2*b - b^3 + (a^3 - a*b^2)*cos(f*x + e)^2)*log(a*cos(f*x + e)^2 + b) + 2*(a^3*
cos(f*x + e)^2 + a^2*b)*log(-cos(f*x + e)))/(a^3*b^2*f*cos(f*x + e)^2 + a^2*b^3*f)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tan ^{5}{\left (e + f x \right )}}{\left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**5/(a+b*sec(f*x+e)**2)**2,x)

[Out]

Integral(tan(e + f*x)**5/(a + b*sec(e + f*x)**2)**2, x)

________________________________________________________________________________________

Giac [B]  time = 3.30719, size = 770, normalized size = 10. \begin{align*} \frac{\frac{{\left (a^{3} + a^{2} b - a b^{2} - b^{3}\right )} \log \left ({\left | -a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 2 \, a + 2 \, b \right |}\right )}{a^{3} b^{2} + a^{2} b^{3}} + \frac{\log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}{a^{2}} - \frac{\log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right )}{b^{2}} - \frac{a^{3}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + a^{2} b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - a b^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - b^{3}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 2 \, a^{3} - 6 \, a^{2} b - 6 \, a b^{2} + 2 \, b^{3}}{{\left (a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 2 \, a - 2 \, b\right )} a^{2} b^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*((a^3 + a^2*b - a*b^2 - b^3)*log(abs(-a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f
*x + e) + 1)) - b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - 2*a + 2*b)
)/(a^3*b^2 + a^2*b^3) + log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2
)/a^2 - log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2)/b^2 - (a^3*((c
os(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + a^2*b*((cos(f*x + e) + 1)/(cos(
f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - a*b^2*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f
*x + e) - 1)/(cos(f*x + e) + 1)) - b^3*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x +
e) + 1)) + 2*a^3 - 6*a^2*b - 6*a*b^2 + 2*b^3)/((a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/
(cos(f*x + e) + 1)) + b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 2*a
- 2*b)*a^2*b^2))/f